package com.douglas.managesystem.common;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @Description 时间工具类
 * @Author 以梦为馬 <Douglas1314@126.com>
 * @Version V1.0.0
 * @Date 2020-10-16 9:45
 **/
public class DateUtils {

    /**
     * Sting类型时间转换为Date类型
     * @param time
     * @return
     */
    public static Date stringToDate(String time){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date date = null;
        try {
            date = sdf.parse(time);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return date;
    }
}
